3.907 \(\int \frac{\cos ^4(c+d x) (A+B \sec (c+d x)+C \sec ^2(c+d x))}{a+b \sec (c+d x)} \, dx\)

Optimal. Leaf size=276 \[ -\frac{\sin (c+d x) \left (a^2 b (2 A+3 C)-2 a^3 B-3 a b^2 B+3 A b^3\right )}{3 a^4 d}+\frac{\sin (c+d x) \cos (c+d x) \left (a^2 (3 A+4 C)-4 a b B+4 A b^2\right )}{8 a^3 d}-\frac{2 b^3 \left (A b^2-a (b B-a C)\right ) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 d \sqrt{a-b} \sqrt{a+b}}+\frac{x \left (4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)-4 a^3 b B-8 a b^3 B+8 A b^4\right )}{8 a^5}-\frac{(A b-a B) \sin (c+d x) \cos ^2(c+d x)}{3 a^2 d}+\frac{A \sin (c+d x) \cos ^3(c+d x)}{4 a d} \]

[Out]

((8*A*b^4 - 4*a^3*b*B - 8*a*b^3*B + 4*a^2*b^2*(A + 2*C) + a^4*(3*A + 4*C))*x)/(8*a^5) - (2*b^3*(A*b^2 - a*(b*B
 - a*C))*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a^5*Sqrt[a - b]*Sqrt[a + b]*d) - ((3*A*b^3 - 2*
a^3*B - 3*a*b^2*B + a^2*b*(2*A + 3*C))*Sin[c + d*x])/(3*a^4*d) + ((4*A*b^2 - 4*a*b*B + a^2*(3*A + 4*C))*Cos[c
+ d*x]*Sin[c + d*x])/(8*a^3*d) - ((A*b - a*B)*Cos[c + d*x]^2*Sin[c + d*x])/(3*a^2*d) + (A*Cos[c + d*x]^3*Sin[c
 + d*x])/(4*a*d)

________________________________________________________________________________________

Rubi [A]  time = 1.10384, antiderivative size = 276, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.122, Rules used = {4104, 3919, 3831, 2659, 208} \[ -\frac{\sin (c+d x) \left (a^2 b (2 A+3 C)-2 a^3 B-3 a b^2 B+3 A b^3\right )}{3 a^4 d}+\frac{\sin (c+d x) \cos (c+d x) \left (a^2 (3 A+4 C)-4 a b B+4 A b^2\right )}{8 a^3 d}-\frac{2 b^3 \left (A b^2-a (b B-a C)\right ) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 d \sqrt{a-b} \sqrt{a+b}}+\frac{x \left (4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)-4 a^3 b B-8 a b^3 B+8 A b^4\right )}{8 a^5}-\frac{(A b-a B) \sin (c+d x) \cos ^2(c+d x)}{3 a^2 d}+\frac{A \sin (c+d x) \cos ^3(c+d x)}{4 a d} \]

Antiderivative was successfully verified.

[In]

Int[(Cos[c + d*x]^4*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + b*Sec[c + d*x]),x]

[Out]

((8*A*b^4 - 4*a^3*b*B - 8*a*b^3*B + 4*a^2*b^2*(A + 2*C) + a^4*(3*A + 4*C))*x)/(8*a^5) - (2*b^3*(A*b^2 - a*(b*B
 - a*C))*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a^5*Sqrt[a - b]*Sqrt[a + b]*d) - ((3*A*b^3 - 2*
a^3*B - 3*a*b^2*B + a^2*b*(2*A + 3*C))*Sin[c + d*x])/(3*a^4*d) + ((4*A*b^2 - 4*a*b*B + a^2*(3*A + 4*C))*Cos[c
+ d*x]*Sin[c + d*x])/(8*a^3*d) - ((A*b - a*B)*Cos[c + d*x]^2*Sin[c + d*x])/(3*a^2*d) + (A*Cos[c + d*x]^3*Sin[c
 + d*x])/(4*a*d)

Rule 4104

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^
(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(A*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m +
1)*(d*Csc[e + f*x])^n)/(a*f*n), x] + Dist[1/(a*d*n), Int[(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^(n + 1)*Simp[
a*B*n - A*b*(m + n + 1) + a*(A + A*n + C*n)*Csc[e + f*x] + A*b*(m + n + 2)*Csc[e + f*x]^2, x], x], x] /; FreeQ
[{a, b, d, e, f, A, B, C, m}, x] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]

Rule 3919

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(c*x)/a,
x] - Dist[(b*c - a*d)/a, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\cos ^4(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx &=\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac{\int \frac{\cos ^3(c+d x) \left (4 (A b-a B)-a (3 A+4 C) \sec (c+d x)-3 A b \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{4 a}\\ &=-\frac{(A b-a B) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d}+\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}+\frac{\int \frac{\cos ^2(c+d x) \left (3 \left (4 b (A b-a B)+a^2 (3 A+4 C)\right )+a (A b+8 a B) \sec (c+d x)-8 b (A b-a B) \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{12 a^2}\\ &=\frac{\left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 a^3 d}-\frac{(A b-a B) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d}+\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac{\int \frac{\cos (c+d x) \left (8 \left (3 A b^3-2 a^3 B-3 a b^2 B+a^2 b (2 A+3 C)\right )+a \left (4 A b^2-4 a b B-3 a^2 (3 A+4 C)\right ) \sec (c+d x)-3 b \left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{24 a^3}\\ &=-\frac{\left (3 A b^3-2 a^3 B-3 a b^2 B+a^2 b (2 A+3 C)\right ) \sin (c+d x)}{3 a^4 d}+\frac{\left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 a^3 d}-\frac{(A b-a B) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d}+\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}+\frac{\int \frac{3 \left (8 A b^4-4 a^3 b B-8 a b^3 B+4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)\right )+3 a b \left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{24 a^4}\\ &=\frac{\left (8 A b^4-4 a^3 b B-8 a b^3 B+4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)\right ) x}{8 a^5}-\frac{\left (3 A b^3-2 a^3 B-3 a b^2 B+a^2 b (2 A+3 C)\right ) \sin (c+d x)}{3 a^4 d}+\frac{\left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 a^3 d}-\frac{(A b-a B) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d}+\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac{\left (b^3 \left (A b^2-a (b B-a C)\right )\right ) \int \frac{\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a^5}\\ &=\frac{\left (8 A b^4-4 a^3 b B-8 a b^3 B+4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)\right ) x}{8 a^5}-\frac{\left (3 A b^3-2 a^3 B-3 a b^2 B+a^2 b (2 A+3 C)\right ) \sin (c+d x)}{3 a^4 d}+\frac{\left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 a^3 d}-\frac{(A b-a B) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d}+\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac{\left (b^2 \left (A b^2-a (b B-a C)\right )\right ) \int \frac{1}{1+\frac{a \cos (c+d x)}{b}} \, dx}{a^5}\\ &=\frac{\left (8 A b^4-4 a^3 b B-8 a b^3 B+4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)\right ) x}{8 a^5}-\frac{\left (3 A b^3-2 a^3 B-3 a b^2 B+a^2 b (2 A+3 C)\right ) \sin (c+d x)}{3 a^4 d}+\frac{\left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 a^3 d}-\frac{(A b-a B) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d}+\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac{\left (2 b^2 \left (A b^2-a (b B-a C)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{a}{b}+\left (1-\frac{a}{b}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{a^5 d}\\ &=\frac{\left (8 A b^4-4 a^3 b B-8 a b^3 B+4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)\right ) x}{8 a^5}-\frac{2 b^3 \left (A b^2-a (b B-a C)\right ) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^5 \sqrt{a-b} \sqrt{a+b} d}-\frac{\left (3 A b^3-2 a^3 B-3 a b^2 B+a^2 b (2 A+3 C)\right ) \sin (c+d x)}{3 a^4 d}+\frac{\left (4 A b^2-4 a b B+a^2 (3 A+4 C)\right ) \cos (c+d x) \sin (c+d x)}{8 a^3 d}-\frac{(A b-a B) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d}+\frac{A \cos ^3(c+d x) \sin (c+d x)}{4 a d}\\ \end{align*}

Mathematica [A]  time = 0.831756, size = 235, normalized size = 0.85 \[ \frac{12 (c+d x) \left (4 a^2 b^2 (A+2 C)+a^4 (3 A+4 C)-4 a^3 b B-8 a b^3 B+8 A b^4\right )+24 a^2 \sin (2 (c+d x)) \left (a^2 (A+C)-a b B+A b^2\right )+24 a \sin (c+d x) \left (-a^2 b (3 A+4 C)+3 a^3 B+4 a b^2 B-4 A b^3\right )+\frac{192 b^3 \left (a (a C-b B)+A b^2\right ) \tanh ^{-1}\left (\frac{(b-a) \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}+8 a^3 (a B-A b) \sin (3 (c+d x))+3 a^4 A \sin (4 (c+d x))}{96 a^5 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[c + d*x]^4*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + b*Sec[c + d*x]),x]

[Out]

(12*(8*A*b^4 - 4*a^3*b*B - 8*a*b^3*B + 4*a^2*b^2*(A + 2*C) + a^4*(3*A + 4*C))*(c + d*x) + (192*b^3*(A*b^2 + a*
(-(b*B) + a*C))*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/Sqrt[a^2 - b^2] + 24*a*(-4*A*b^3 + 3*a^3
*B + 4*a*b^2*B - a^2*b*(3*A + 4*C))*Sin[c + d*x] + 24*a^2*(A*b^2 - a*b*B + a^2*(A + C))*Sin[2*(c + d*x)] + 8*a
^3*(-(A*b) + a*B)*Sin[3*(c + d*x)] + 3*a^4*A*Sin[4*(c + d*x)])/(96*a^5*d)

________________________________________________________________________________________

Maple [B]  time = 0.134, size = 1580, normalized size = 5.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x)

[Out]

1/a/d*arctan(tan(1/2*d*x+1/2*c))*C+3/4/a/d*A*arctan(tan(1/2*d*x+1/2*c))-1/d/a^2*arctan(tan(1/2*d*x+1/2*c))*B*b
-10/3/d/a^2/(1+tan(1/2*d*x+1/2*c)^2)^4*tan(1/2*d*x+1/2*c)^3*A*b-10/3/d/a^2/(1+tan(1/2*d*x+1/2*c)^2)^4*tan(1/2*
d*x+1/2*c)^5*A*b-1/d/a^2/(1+tan(1/2*d*x+1/2*c)^2)^4*tan(1/2*d*x+1/2*c)*B*b+6/d/a^3/(1+tan(1/2*d*x+1/2*c)^2)^4*
tan(1/2*d*x+1/2*c)^5*b^2*B-2/d/a^4/(1+tan(1/2*d*x+1/2*c)^2)^4*tan(1/2*d*x+1/2*c)*A*b^3-6/d/a^4/(1+tan(1/2*d*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d*x+1/2*c)^2)^4*tan(1/2*d*x+1/2*c)^5*A*b^2-2/d/a^2/(1+tan(1/2*d*x+
1/2*c)^2)^4*tan(1/2*d*x+1/2*c)^7*A*b

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 0.703641, size = 1690, normalized size = 6.12 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

[1/24*(3*((3*A + 4*C)*a^6 - 4*B*a^5*b + (A + 4*C)*a^4*b^2 - 4*B*a^3*b^3 + 4*(A - 2*C)*a^2*b^4 + 8*B*a*b^5 - 8*
A*b^6)*d*x + 12*(C*a^2*b^3 - B*a*b^4 + A*b^5)*sqrt(a^2 - b^2)*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x
+ c)^2 - 2*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*
x + c) + b^2)) + (16*B*a^6 - 8*(2*A + 3*C)*a^5*b + 8*B*a^4*b^2 - 8*(A - 3*C)*a^3*b^3 - 24*B*a^2*b^4 + 24*A*a*b
^5 + 6*(A*a^6 - A*a^4*b^2)*cos(d*x + c)^3 + 8*(B*a^6 - A*a^5*b - B*a^4*b^2 + A*a^3*b^3)*cos(d*x + c)^2 + 3*((3
*A + 4*C)*a^6 - 4*B*a^5*b + (A - 4*C)*a^4*b^2 + 4*B*a^3*b^3 - 4*A*a^2*b^4)*cos(d*x + c))*sin(d*x + c))/((a^7 -
 a^5*b^2)*d), 1/24*(3*((3*A + 4*C)*a^6 - 4*B*a^5*b + (A + 4*C)*a^4*b^2 - 4*B*a^3*b^3 + 4*(A - 2*C)*a^2*b^4 + 8
*B*a*b^5 - 8*A*b^6)*d*x - 24*(C*a^2*b^3 - B*a*b^4 + A*b^5)*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*cos(d*
x + c) + a)/((a^2 - b^2)*sin(d*x + c))) + (16*B*a^6 - 8*(2*A + 3*C)*a^5*b + 8*B*a^4*b^2 - 8*(A - 3*C)*a^3*b^3
- 24*B*a^2*b^4 + 24*A*a*b^5 + 6*(A*a^6 - A*a^4*b^2)*cos(d*x + c)^3 + 8*(B*a^6 - A*a^5*b - B*a^4*b^2 + A*a^3*b^
3)*cos(d*x + c)^2 + 3*((3*A + 4*C)*a^6 - 4*B*a^5*b + (A - 4*C)*a^4*b^2 + 4*B*a^3*b^3 - 4*A*a^2*b^4)*cos(d*x +
c))*sin(d*x + c))/((a^7 - a^5*b^2)*d)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4*(A+B*sec(d*x+c)+C*sec(d*x+c)**2)/(a+b*sec(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.31537, size = 1081, normalized size = 3.92 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

1/24*(3*(3*A*a^4 + 4*C*a^4 - 4*B*a^3*b + 4*A*a^2*b^2 + 8*C*a^2*b^2 - 8*B*a*b^3 + 8*A*b^4)*(d*x + c)/a^5 - 48*(
C*a^2*b^3 - B*a*b^4 + A*b^5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